package config;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.servlet.view.freemarker.FreeMarkerView;

public class FreeMarkerViewCustom extends FreeMarkerView
{

	// buildTemplateModel 重写这个也可以
	@Override
	protected void exposeHelpers(Map<String, Object> model, HttpServletRequest request) throws Exception
	{
		// Subject subject = SecurityUtils.getSubject();
		// boolean isAuthenticated = subject.isAuthenticated();
		// if (isAuthenticated)
		// {
		// User user = (User) subject.getPrincipal();
		// model.put("currentUser", user);
		// model.put("subject", subject);
		// }
		super.exposeHelpers(model, request);
	}
}
